package com.leyou.item.api;

import com.leyou.item.pojo.Category;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: taft
 * @Date: 2018-10-18 11:08
 */
@RequestMapping("category")
public interface CategoryApi {

    @GetMapping("list")
    List<Category> queryByParentId(@RequestParam(value = "pid", defaultValue = "0") Long pid);


    /**
     * 通过品牌id查询商品分类
     *
     * @param bid
     * @return
     */
    @GetMapping("bid/{bid}")
    List<Category> queryByBrandId(@PathVariable("bid") Long bid);


    /**
     * 根据商品分类id查询名称
     *
     * @param ids 要查询的分类id集合
     * @return 多个名称的集合
     */
    @GetMapping("names")
    List<String> queryNameByIds(@RequestParam("ids") List<Long> ids);

}